package concurrent.lock;

import java.util.Queue;

/**
 * Author: Jason Wu
 * Date  : 2013-11-28
 */
public class RemoveObjectTask implements Runnable {
    private final Queue<Integer> numberList;

    public RemoveObjectTask(Queue<Integer> numberList) {
        this.numberList = numberList;
    }

    @Override
    public void run() {
        synchronized (numberList) {
            System.out.println(numberList.poll());
        }
    }
}
